package com.douhl.project.business.visitor.service.impl;

import java.util.List;
import com.douhl.common.utils.DateUtils;
import com.douhl.framework.web.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.douhl.project.business.visitor.mapper.BusinessVisitorMapper;
import com.douhl.project.business.visitor.domain.BusinessVisitor;
import com.douhl.project.business.visitor.service.IBusinessVisitorService;

/**
 * 访客记录Service业务层处理
 *
 * @author douhl
 * @date 2020-08-18
 */
@Service
public class BusinessVisitorServiceImpl extends BaseServiceImpl<BusinessVisitorMapper, BusinessVisitor> implements IBusinessVisitorService
{
    @Autowired
    private BusinessVisitorMapper businessVisitorMapper;

    /**
     * 查询访客记录
     *
     * @param id 访客记录ID
     * @return 访客记录
     */
    @Override
    public BusinessVisitor selectBusinessVisitorById(Long id)
    {
        return businessVisitorMapper.selectBusinessVisitorById(id);
    }

    /**
     * 查询访客记录列表
     *
     * @param businessVisitor 访客记录
     * @return 访客记录
     */
    @Override
    public List<BusinessVisitor> selectBusinessVisitorList(BusinessVisitor businessVisitor)
    {
        return businessVisitorMapper.selectBusinessVisitorList(businessVisitor);
    }

    /**
     * 新增访客记录
     *
     * @param businessVisitor 访客记录
     * @return 结果
     */
    @Override
    public int insertBusinessVisitor(BusinessVisitor businessVisitor)
    {
        businessVisitor.setCreateTime(DateUtils.getNowDate());
        return businessVisitorMapper.insertBusinessVisitor(businessVisitor);
    }

    /**
     * 修改访客记录
     *
     * @param businessVisitor 访客记录
     * @return 结果
     */
    @Override
    public int updateBusinessVisitor(BusinessVisitor businessVisitor)
    {
        businessVisitor.setUpdateTime(DateUtils.getNowDate());
        return businessVisitorMapper.updateBusinessVisitor(businessVisitor);
    }

    /**
     * 批量删除访客记录
     *
     * @param ids 需要删除的访客记录ID
     * @return 结果
     */
    @Override
    public int deleteBusinessVisitorByIds(Long[] ids)
    {
        return businessVisitorMapper.deleteBusinessVisitorByIds(ids);
    }

    /**
     * 删除访客记录信息
     *
     * @param id 访客记录ID
     * @return 结果
     */
    @Override
    public int deleteBusinessVisitorById(Long id)
    {
        return businessVisitorMapper.deleteBusinessVisitorById(id);
    }
}
